package com.fujitsu.nanjing.tieba.dao;

import com.fujitsu.nanjing.tieba.ibator.CoreReportLog;
import com.fujitsu.nanjing.tieba.ibator.CoreReportLogCriteria;
import java.util.List;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class CoreReportLogDAOImpl extends SqlMapClientDaoSupport implements CoreReportLogDAO {

    public CoreReportLogDAOImpl() {
        super();
    }

    public int countByExample(CoreReportLogCriteria example) {
        Integer count = (Integer)  getSqlMapClientTemplate().queryForObject("core_report_log.countByExample", example);
        return count;
    }

    public int deleteByExample(CoreReportLogCriteria example) {
        int rows = getSqlMapClientTemplate().delete("core_report_log.deleteByExample", example);
        return rows;
    }

    public int deleteByPrimaryKey(Integer logid) {
        CoreReportLog _key = new CoreReportLog();
        _key.setLogid(logid);
        int rows = getSqlMapClientTemplate().delete("core_report_log.deleteByPrimaryKey", _key);
        return rows;
    }

    public void insert(CoreReportLog record) {
        getSqlMapClientTemplate().insert("core_report_log.insert", record);
    }

    public void insertSelective(CoreReportLog record) {
        getSqlMapClientTemplate().insert("core_report_log.insertSelective", record);
    }

    @SuppressWarnings("unchecked")
    public List<CoreReportLog> selectByExample(CoreReportLogCriteria example) {
        List<CoreReportLog> list = getSqlMapClientTemplate().queryForList("core_report_log.selectByExample", example);
        return list;
    }

    public CoreReportLog selectByPrimaryKey(Integer logid) {
        CoreReportLog _key = new CoreReportLog();
        _key.setLogid(logid);
        CoreReportLog record = (CoreReportLog) getSqlMapClientTemplate().queryForObject("core_report_log.selectByPrimaryKey", _key);
        return record;
    }

    public int updateByExampleSelective(CoreReportLog record, CoreReportLogCriteria example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("core_report_log.updateByExampleSelective", parms);
        return rows;
    }

    public int updateByExample(CoreReportLog record, CoreReportLogCriteria example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("core_report_log.updateByExample", parms);
        return rows;
    }

    public int updateByPrimaryKeySelective(CoreReportLog record) {
        int rows = getSqlMapClientTemplate().update("core_report_log.updateByPrimaryKeySelective", record);
        return rows;
    }

    public int updateByPrimaryKey(CoreReportLog record) {
        int rows = getSqlMapClientTemplate().update("core_report_log.updateByPrimaryKey", record);
        return rows;
    }

    protected static class UpdateByExampleParms extends CoreReportLogCriteria {
        private Object record;

        public UpdateByExampleParms(Object record, CoreReportLogCriteria example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
}